//
//  VideoCell.m
//  copyrightTrading
//
//  Created by 郭子一 on 2020/10/8.
//  Copyright © 2020 郭子一. All rights reserved.
//

#import "VideoCell.h"

@interface VideoCell ()
@property (nonatomic, strong) UIImageView *img;
@property (nonatomic, strong) UILabel *titleLabel;
@end

@implementation VideoCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
//        self.contentView.backgroundColor = RGB_VALUE(0xF5F5F5);
        [self setupUI];
    }
    return self;
}

- (void)setupUI
{
    self.img = [[UIImageView alloc] init];
//    self.img.image = [UIImage imageNamed:@"MineHeaderImg"];
    self.img.backgroundColor = UIColor.brownColor;
    self.img.layer.masksToBounds = YES;
    self.img.layer.cornerRadius = 10;
    [self.contentView addSubview:self.img];
    [self.img mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.offset(0);
        make.height.mas_equalTo(108);
    }];
    
    self.titleLabel = [UILabel new];
    self.titleLabel.text = @"视频标题标题";
    self.titleLabel.font = JSS_MEDIUM_FONT(14);
    self.titleLabel.textColor = RGB_VALUE(0x4A4A4A);
    [self.contentView addSubview:self.titleLabel];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.offset(0);
        make.left.offset(10);
        make.right.offset(0);
        make.height.mas_equalTo(20);
    }];
}

- (void)setDataDic:(NSDictionary *)dataDic
{
    _dataDic = dataDic;
    [self.img m_setImageWithUrlString:dataDic[@"thumb"] placeholder:@"placeholderImg"];
    self.titleLabel.text = dataDic[@"title"];
}

@end
